<?php

use app\common\enum\order\PayType as PayTypeEnum;
?>

<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">大额提现订单</div>
                </div>
                <div class="widget-body am-fr">
                    <!-- 工具栏 -->
                   

                    <div class="page_toolbar am-margin-bottom-xs am-cf">
                        <form id="form-search" class="toolbar-form" action="">
                            <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
                            <div class="am-u-sm-12 am-u-md-9" style="float: right;">
                                <div class="am fr">
                                    <div class="am-form-group am-fl">
                                        <select name="apply_status"
                                                data-am-selected="{btnSize: 'sm', placeholder: '审核状态(全部)'}">

                                            <option value="-1" <?= $request->get('apply_status') == '-1' ? 'selected' : '' ?>>
                                                审核状态(全部)
                                            </option>
                                            <option value="10" <?= $request->get('apply_status') === '10' ? 'selected' : '' ?>>
                                                审核中
                                            </option>
                                            <option value="20" <?= $request->get('apply_status') == '20' ? 'selected' : '' ?>>
                                                通过
                                            </option>
                                            <option value="30" <?= $request->get('apply_status') === '30' ? 'selected' : '' ?>>
                                                驳回
                                            </option>

                                        </select>
                                    </div>
                                    <div class="am-form-group tpl-form-border-form am-fl">
                                        <input type="text" name="start_time"
                                               class="am-form-field"
                                               value="<?= $request->get('start_time') ?>" placeholder="请选择起始日期"
                                               data-am-datepicker readonly>
                                    </div>
                                    <div class="am-form-group tpl-form-border-form am-fl">
                                        <input type="text" name="end_time"
                                               class="am-form-field"
                                               value="<?= $request->get('end_time') ?>" placeholder="请选择截止日期"
                                               data-am-datepicker readonly>

                                    </div>
                                    <div class="am-form-group am-fl">
                                        <div class="am-input-group am-input-group-sm tpl-form-border-form">

                                            <div class="am-input-group-btn" style="width: auto;">
                                                <button class="am-btn am-btn-default am-icon-search"
                                                        type="submit"></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>

                    </div>
                    <div class="order-list am-scrollable-horizontal am-u-sm-12 am-margin-top-xs">
                        <table width="100%" class="am-table am-table-centered
                        am-text-nowrap am-margin-bottom-xs">
                            <thead>
                            <tr>
                                <th width="5%">订单id</th>
                                <th width="7%">提现额度</th>
                                <th width="7%">实际到账</th>
                                <th width="7%">申请时间</th>
                                <th width="7%">审核时间</th>
                                <th width="7%">审核状态</th>
                                <th width="7%">驳回理由</th>
                                <th width="7%">审核人</th>
                            </tr>
                            </thead>
                            <tbody>

                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="am-text-middle"><?= $item['money']*100 ?></td>
                                    <td class="am-text-middle"><?= $item['money'] ?></td>
                                    <td class="am-text-middle"><?=format_time((int)$item['apply_time'])?></td>
                                    <td class="am-text-middle">
                                        <?php if ($item['update_time'] ==0) : ?>
                                            <span class="x-color-green">----</span>
                                        <?php elseif($item['update_time']>0): ?>
                                            <span class="x-color-red"><?=format_time((int)$item['update_time'])?></span>
                                        <?php endif; ?>
                                    </td>
                                    <td class="am-text-middle">
                                        <?php if ($item['apply_status'] ==10) : ?>
                                            <span class="x-color-green">审核中</span>
                                        <?php elseif($item['apply_status'] ==20): ?>
                                            <span class="x-color-green">已通过</span>
                                        <?php elseif($item['apply_status'] ==30): ?>
                                            <span class="x-color-red">已驳回</span>
                                        <?php endif; ?>
                                    </td>

                                    <td class="am-text-middle">
                                        <span class="x-color-red"><?=$item['back_reason']?></span>
                                    </td>
                                    <td class="am-text-middle"><?= getadminInfo($item['admin_id'])?></td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="9" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



